let a = 10;
let b = "20";
let c = 80;
console.log(--c + +b + --a * +b++ - +b * a + --a - +true);
**I think I should get 108 then multiple it by -1 then multiple it by 16 which should result in -1728 however I am getting an answer of 97!!!!
how is that possible?
when I broke the problem into 3 pieces (--c + +b + --a)(+b++ - +b)(a + --a - +true) the computer agreed with me that the first part should be 108 then -1.
I need help guys. someone explain it to me, please.
THANKS**
This is because of order/preference of operations. as multiplication has higher preference than addition and subtraction.
just put bracers like below it will give required output (-1728).
console.log((--c + +b + --a) * (+b++ - +b) * (a + --a - +true));